using System.Collections;
using System.Collections.Generic;

using TMPro;

using UnityEngine;

//[ExecuteInEditMode]
public class ItemLoad : MonoBehaviour
{
	public string[] labels = new string[]{"A1: ","A2: ","A3: ","A4: ","A5: ","A6: ","A7: ","A8: ","A9: ","A10:","A11:","A12:","A13:","B1: ","B2: ","B3: ","B4: ","B5: ","B6: ","B7: ","B8: ","B9: ","B10:","B11:","B12:","B13:"};
    void Update()
    {
        SetChildText();
	}

    void SetChildText ()
    {
		int childCount = transform.childCount;
		for (int i = 0; i < childCount; i++)
		{
			Transform child = transform.GetChild(i);
			TextMeshPro label = child.GetComponent<TextMeshPro>();
			if (label != null)
			{
				label.text = labels[i];
			}
			else
			{
				Debug.LogError("Child " + i + " does not have a TextMeshPro component!");
			}
		}
	}
}
